package com.jinbai.searcher.web.search_web;

import lombok.Data;

@Data
public class DocumentWithWeight {
	private int docId;
	private String title;
	private String url;
	private String content;
	private int weight;

	public DocumentWithWeight() {}
	public DocumentWithWeight(DocumentWithWeight documentWithWeight) {
		this.docId = documentWithWeight.getDocId();
		this.title = documentWithWeight.getTitle();
		this.url = documentWithWeight.getUrl();
		this.content = documentWithWeight.getContent();
		this.weight = documentWithWeight.getWeight();
	}

	public Document convertToDocument() {
		Document document = new Document();
		document.setDocId(this.docId);
		document.setTitle(this.title);
		document.setUrl(this.url);
		document.setContent(this.content);
		return document;
	}
}
